package static_;

/**
 * @Package: static_
 * @ClassName: ClassValue
 * @Author: x2606
 * @CreateTime: 2022/3/10 14:46
 * @Description: staic 类变量
 */

public class ClassValue {
    public static void main(String[] args) {
        //通过类访问
        System.out.println(Person.name);

        //通过对象访问类变量
        Person person = new Person();
        System.out.println(person.name);
    }
}

class Person{
    public static int count=0;//类变量
    public static String name="static value";

    public Person() {
    }
}

